#ifndef DYNAMIC_ARRAY_H 
#define DYNAMIC_ARRAY_H

#include "array.h"

template<class T>
class DynamicArray : public Array<T>{
private:
    T* arr;
    int sz;
    void init(const int sz);

protected:
    virtual const T* start() const { return arr; }
    virtual T* start() { return arr; }

public:
    DynamicArray(const int sz = 0, const T src[] = 0);
    DynamicArray(const Array<T>& src);

    virtual ~DynamicArray();

    virtual void valid() const;
    virtual int size() const { return sz; }

    void operator=(const Array<T>& src);
};

#include "dynamic_array_impl.h"

#endif /*#define DYNAMIC_ARRAY_H*/
